# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-screenutils
pkgname=('python2-screenutils' 'python-screenutils')
_pkgname=screenutils
pkgver=0.0.1.6.2
pkgrel=9
pkgdesc='Lib for gnu-screen: creates/close/list/log sessions, injects commands...'
arch=('any')
url='https://pypi.org/project/screenutils/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('073b8e0d227c77f80b02bb018e6cddd7d87f4fdb059222dbadcb16c91f667d568a90acc984b5644e86718a2153e83282b0c3208d94792c143f89158a1a05331a')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-screenutils() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-screenutils() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

